package com.lhm.service.impl;

import com.lhm.entity.Student;
import com.lhm.mapper.StudentMapper;
import com.lhm.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: lhm
 * @Date: 2020/12/4 17:44
 * 4
 */
@Service
@Slf4j
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public List<Student> findAll() {
        return studentMapper.findAll();
    }

    @Override
    public void saveBatch(List<Student> students) throws Exception{
        int i = studentMapper.savtBatch(students);
        log.info("成功条数："+i);
    }
}
